package com.accp.vehiclecare.biz.hzbiz;

import com.accp.vehiclecare.dao.hzdao.CommodityMapper;
import com.accp.vehiclecare.dao.hzdao.CommtypeMapper;
import com.accp.vehiclecare.dao.hzdao.CountunitMapper;
import com.accp.vehiclecare.dao.hzdao.goodssourceMapper;
import com.accp.vehiclecare.vo.hzvo.Commodity;
import com.accp.vehiclecare.vo.hzvo.Commtype;
import com.accp.vehiclecare.vo.hzvo.Countunit;
import com.accp.vehiclecare.vo.hzvo.goodssource;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class shopbiz {
    @Autowired(required = false)
    private CommodityMapper commodityMapper;
    @Autowired(required = false)
    private CommtypeMapper commtypeMapper;
    @Autowired(required = false)
    private CountunitMapper countunitMapper;
    @Autowired(required = false)
    private goodssourceMapper goodssourceMapper;
    public PageInfo<Commodity>Showlist(Integer p, Integer s,String name){PageHelper.startPage(p,s);return new PageInfo<Commodity>(commodityMapper.showlist(name));}
    public int Delete(Integer id){return commodityMapper.delete(id);}
    public List<Countunit>showlist2(){return countunitMapper.showlist();}
    public List<goodssource>showlist3(){return goodssourceMapper.showlist2();}
    public List<Commtype>showlist4(){return commtypeMapper.showlist();}
    public int addsp(Commodity commodity){return commodityMapper.addsp(commodity);}
}
